
<template>
  <div class="wrap">
    <router-view></router-view>
    <van-nav-bar title="转账" />
    <div class="grid">
      <van-grid>
        <van-grid-item @click="clickGrid(item.text)" v-for="(item, index) in gridList" :key="index" icon="photo-o"
          :text="item.text" />
      </van-grid>
    </div>
  </div>
</template>

<script>
export default {
  name: 'Transfer',
  data() {
    return {
      gridList: [
        {
          value: "0",
          index: 0,
          text: "转账管理",
        },
        {
          value: "1",
          index: 1,
          text: "单笔转账",
        },
        {
          value: "2",
          index: 2,
          text: "预约转账",
        },
        {
          value: "3",
          index: 3,
          text: "转账记录",
        }
      ],
    };
  },

  computed: {},

  mounted() {

  },

  methods: {
    // 点击宫格
    clickGrid(val) {
      // 以下为路由传参示例-自行修改
      switch (val) {
        case "转账管理":
          this.$router.push({
            name: "transferManagement",
            params: { title: val },
          });
          break;
        case "单笔转账":
          this.$router.push({
            name: "singleTransfer",
            params: { title: val },
          });
          break;
      }
    },
  },

  // this.$router.push({ name: 'transferManagement', params: { title: val }})
};
</script>
<style lang="scss" scoped>
.wrap {
  .grid {
    margin-top: 1rem;
  }
}
</style>
